/*AssistCleanInfo  清洁管理*/
import request from "/@/utils/request";
import download from "/@/utils/download.ts";

const AssistCleanInfoApi = {

    getPageData(data: any) {
        return request({
            url: "/assistCleanInfo/pageData",
            method: "post",
            data,
        });
    },
    getDetail(params: any) {
        return request({
            url: "/assistCleanInfo/getDetail",
            method: "get",
            params,
        });
    },
     getCanciTypeList(){
        return request({
            url: "/sysDic/searchByType?dicClass=meal_times",
            method: "get",
         
        });
    },
    save: (data: any) => {
        return request({
            url: "/assistCleanInfo/save",
            headersType: 'application/json;charset=UTF-8',
            method: "post",
            data,
        });
    },

    del: (data: any) => {
        return request({
            url: "/assistCleanInfo/del",
            method: "post",
            data,
        });
    },

    updateStatus: (data: any) => {
        return request({
            url: "/assistCleanInfo/updateStatus",
            method: "post",
            data,
        });
    },
    pageDataXls:(id: any) => {
        const param = new URLSearchParams();
        // param.append("_searchParam",JSON.stringify(_searchParam))
        // param.append("_xlsTitle",_xlsTitle)
        param.append("assistCleanInfoId",id)
        return request({
            url: "/assistCleanInfo/pageDataXls",
            method: "post",
            responseType: 'blob',
            headersType: 'application/json;charset=UTF-8',
            params:param,
        }).then((res)=> {
            download(res)
        });
    },
    //     pageDataXlss:(_searchParam: any,_xlsTitle: any) => {
    //     const param = new URLSearchParams();
    //     param.append("_searchParam",JSON.stringify(_searchParam))
    //     param.append("_xlsTitle",_xlsTitle)
    //     // param.append("assistCleanInfoId",id)
    //     return request({
    //         url: "/assistCleanInfo/pageDataXls",
    //         method: "post",
    //         responseType: 'blob',
    //         headersType: 'application/json;charset=UTF-8',
    //         params:param,
    //     }).then((res)=> {
    //         download(res)
    //     });
    // },
        pageDataXlss:(_searchParam: any,_xlsTitle: any) => {
                 const param = new URLSearchParams();
            param.append("_searchParam",JSON.stringify(_searchParam))
            param.append("_xlsTitle",_xlsTitle)
            return request({
                url: "/assistCleanInfo/pageDataXls",
                method: "post",
                responseType: 'blob',
                headersType: 'application/json;charset=UTF-8',
              params:param,
            }).then((res)=> {
                download(res)
            });
        },
    excelImport: (data: any)=>{
        return request({
            url: "/assistCleanInfo/importDataXls",
            method: "post",
            headersType:'multipart/form-data',
            data,
        })
    }, 

    batchSave: (data:any)=>{
        return request({
            url: "/assistCleanInfo/batchSave",
            headersType: 'application/json;charset=UTF-8',
            method: "post",
            data,
        })
    },
};
export default AssistCleanInfoApi;
